#include<iostream>
#include<cmath>

using namespace std;

long long shu[1000000];

void qianzhuihe(int x)
{
	shu[0]  = 1;
	for (int j=1;j<=x;j++)
	{
		shu[j] = j*shu[j-1];
	}
}
void chuli()
{
	int n;
	cin >> n;
	long long sum = 0;
	qianzhuihe(n);
	for(int i=1;i<=n;i++)
	{
		//cout << i << "=" << shu[i] << endl;
		sum +=shu[i];
	}
	cout << sum;	
}
int main()
{
	chuli();
	return 0;	
} 
